Skip to content

[docker in docker] Adds retries for docker daemon startup and cgroup nesting - #669

Merged
Samruddhi Khandale (samruddhikhandale) merged 7 commits into
mainfrom
samruddhikhandale/docker-in-docker
Aug 24, 2023
Merged

[docker in docker] Adds retries for docker daemon startup and cgroup nesting#669
Samruddhi Khandale (samruddhikhandale) merged 7 commits into
mainfrom
samruddhikhandale/docker-in-docker

Conversation

@samruddhikhandale

@samruddhikhandale Samruddhi Khandale (samruddhikhandale) commented Aug 24, 2023

Copy link
Copy Markdown
Member

Ref: #634 and #660

Updates in this PR -

  • 19c9892 adds retries for docker daemon startup
  • We have seen errors like sed: couldn't flush stdout: Device or resource errors which fails to start docker.25d2e80 adds retries to fix such sed errors
  • 4b2c9fc adds a workflow which runs 100 jobs for validating docker startup --> 50 jobs validates dockerd after the container is started, and 50 jobs validates within the onCreateCommand

Important Note: /usr/local/share/docker-init.sh which starts/retries dockerd is added to the entrypoint command. This command runs in the background and is not a blocking script for the container startup. Since it's in the background, onCreateCommand/postCreateCommand/postStartCommand could all start executing before docker is fully running. If it takes docker too long, that could introduce flakiness in those lifecycle scripts.

Opened devcontainers/spec#299 which requests a new semantics to have "blocking" entrypoints that the CLI waits for. This way we can ensure that docker is already up and running for the mentioned ^ lifecycle scripts and is available in the container.

@samruddhikhandale Samruddhi Khandale (samruddhikhandale) changed the title Samruddhikhandale/docker in docker [docker in docker] Adds retries for docker daemon startup and cgroup nesting Aug 24, 2023
@samruddhikhandale

Copy link
Copy Markdown
Member Author

Note: The failing test will be fixed with #661

@samruddhikhandale
Samruddhi Khandale (samruddhikhandale) marked this pull request as ready for review August 24, 2023 18:40

@joshspicer joshspicer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! This looks really reasonable and the 50 passing tests doesn't hurt 😉

@samruddhikhandale

Samruddhi Khandale (samruddhikhandale) commented Aug 24, 2023

Copy link
Copy Markdown
Member Author

nice! This looks really reasonable and the 50 passing tests doesn't hurt 😉

joshspicer **100 😛
See https://github.com/devcontainers/features/actions/runs/5967344918/job/16188845503?pr=669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants